package com.ry.aop;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * AOP配置
 */
@EnableAspectJAutoProxy // 开启切面动态代理
@Configuration
public class AopConfig {


    // 将计算service注册到spring容器
    @Bean
    public MathService mathService(){
        return new MathService();
    }

    // 将切面注册到spring容器
    @Bean
    public MyAspects myAspects(){
        return new MyAspects();
    }


}
